package com.wumz.spring.write.v1.demo.controller;

import com.wumz.spring.write.v1.demo.service.IDemoService;
import com.wumz.spring.write.v1.mvcframework.annotation.MyAutowired;
import com.wumz.spring.write.v1.mvcframework.annotation.MyController;
import com.wumz.spring.write.v1.mvcframework.annotation.MyRequestMapping;
import com.wumz.spring.write.v1.mvcframework.annotation.MyRequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by wumz on 2020/9/26 13:38
 */
@MyController
@MyRequestMapping("/demo")
public class DemoController {

    @MyAutowired
    private IDemoService demoService;

    @MyRequestMapping("/query")
    public void query(HttpServletRequest req, HttpServletResponse resp,
                      @MyRequestParam("name") String name){
//        String result = demoService.get(name);
		String result = "My name is " + name +"，性别：男，爱好：女  over";
        try {
            resp.getWriter().write(result);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
